package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.entity.Product;
import com.project.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "商品接口")
@RequestMapping("product")
public class ProductController {
    @Autowired
    private ProductService productService;
    @ApiOperation(value = "动态条件分页查商品集合")
    @GetMapping("cutByItem/{pageNum}/{productName}/{type}")
    public IPage<Product> cutByItem(@PathVariable("pageNum") Integer pageNum, @PathVariable("productName") String productName, @PathVariable("type") String type) {
        return productService.cutByItem(pageNum,productName,type);
    }
}
